<?php
/**
 * Created by PhpStorm.
 * User: BlueIdeaLirui
 * Date: 2019/8/20
 * Time: 15:08
 */

namespace console\controllers\marketDataAnalysis\upgrade;

use business\datacenter\services\upgrade\LandCronService;
use yii\console\Controller;

class LandController extends Controller
{
    /**
     * 市场数据同步
     * php yii marketDataAnalysis/upgrade/land/process-land-data-rsync-to-es
     * 参数分别传入1,2,3 （拿地数据，开工数据，项目数据）
     * $isCreateIndex 传入0则不再创建索引
     */
    public function actionProcessLandDataRsyncToEs($type = 1, $isCreateIndex = 1, $page = 0)
    {
        try {
            $landCronService = new LandCronService();
            $landCronService->processLandDataRsyncToEs($type, $isCreateIndex, $page);
            echo date('Y-m-d H:i:s') . "拿地数据/开工数据/项目数据同步到es完成\n";
        } catch (\Exception $ex) {
            \Yii::error($ex->getMessage());
            echo '拿地数据/开工数据/项目数据同步到es出错，错误信息：'.$ex->getMessage();
        }
    }
}
